@extends('app')

@section('content')
<div class="layui-card" style="height:100vh;">
    <div class="layui-fluid">
        <div class="layui-row layui-col-space15">
            <div class="layui-col-md12">
                @component('form.form',['id'=>'form'])
                    @include('form.select',[
                        'label'     => '上级导航',
                        'name'      => 'pid',
                        'class'     => 'layui-col-md12',
                        'val'       => $nav,
                        'first'     => '顶级导航',
                        'checked'   => empty($model->pid)?$pid:$model->pid
                    ])

                    @include('form.input',[
                        'label' => '导航名称',
                        'name'  => 'name',
                        'class' => 'layui-col-md12',
                        'val'   => $model->name??''
                    ])

                    @include('form.icon',[
                        'val'   => $model->icon??'',
                    ])

                    @include('form.input',[
                        'label' => '导航链接',
                        'name'  => 'link',
                        'must'  => false,
                        'class' => 'layui-col-md12',
                        'val'   => $model->link??''
                    ])

                    @include('form.input',[
                        'label' => '导航排序',
                        'name'  => 'sort',
                        'class' => 'layui-col-md12',
                        'val'   => $model->sort??'99'
                    ])

                    @if($type!=1&&empty($id))
                        @include('form.checkbox',[
                               'label' => '分配角色',
                               'name'  => 'role[]',
                               'class' => 'layui-col-md12',
                               'style' => 'primary',
                               'val'   => $role??[]
                           ])
                    @endif

                    @include('form.submit',['label'=>'立即提交','form'=>'form','reload'=>"parent.location.reload('treeTable');"])
                @endcomponent
            </div>
        </div>
    </div>
</div>
@endsection

@section('js')

@endsection